//
//  AppDelegate.swift
//  TodayNews
//
//  Created by 郝庆 on 16/8/22.
//  Copyright © 2016年 haoqing. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        
        window = UIWindow(frame: UIScreen.mainScreen().bounds)
        
        // 创建窗口的根控制器
//        print(NSUserDefaults.standardUserDefaults().boolForKey(HQFirstLaunch))
        
        // 检测用户是不是第一次启动
        if !NSUserDefaults.standardUserDefaults().boolForKey(HQFirstLaunch) {
            // 是第一次启动
            window?.rootViewController = HQFirstIntroduceController()
            NSUserDefaults.standardUserDefaults().setBool(true, forKey: HQFirstLaunch)
        } else {
            let tabBarController = HQTabBarController()
            
            window?.rootViewController = tabBarController

        }
        
        window?.makeKeyAndVisible()
        
        return true
    }


}

